
from flask import Blueprint, request, render_template
from sqlalchemy import desc
from applications.common.utils.http import table_api
from applications.common.utils.rights import authorize
from applications.models import AdminLog
from applications.schemas import LogOutSchema
from applications.common.curd import model_to_dicts
from applications.common.utils.validate import str_escape

# from applications.common.screenshot import startScreenshot

import applications.common.screenshot as screenshot
from applications.common.utils.http import table_api, fail_api, success_api


'''
通用工具请求
'''
utilView = Blueprint('utilView', __name__, url_prefix='/ye/util')


# 调用截图工具，并返回保存路径
@utilView.get('/screenshot')
def getScreenshot():
    # 获取请求参数
    # type_name = str_escape(request.args.get('typeName', type=str))
    screenshot.startScreenshot()
    return success_api(msg="截图完成")